package com.keba.otp.db.mysql;

import java.sql.DriverManager;
import java.sql.SQLException;
/**
 * MySQL adatbazissal JDBC-n keresztuli kapcsolatot letrehozo osztaly
 * @author bejmuller
 *
 */
public class MySQLConnection {
	
	/**
	 * Megvalositja a kapcsolatot a MySQL adatbazissal, JDBC-n keresztul
	 * @return a megvalositott Connection
	 */
	public static  java.sql.Connection getConnection() {
		java.sql.Connection conn = null;
		try {
			
			Class.forName("com.mysql.jdbc.Driver").newInstance();
			conn = DriverManager.getConnection("jdbc:mysql://localhost/proba",
					"root",
					"jelszo");
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return conn;
	}
}
